
<%@ page import="projectmanagerapp.Project" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'project.label', default: 'Project')}" />
		<title><g:message code="default.show.label" args="[entityName]" /></title>
	</head>
	<body>
		<a href="#show-project" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>
		<div class="nav" role="navigation">
			<ul>
				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>
				<li><g:link class="list" controller= "manager" action="index"><g:message code="Admin" args="[entityName]" /></g:link></li>
				<li><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></li>
				<li><g:link class="list" action="create"><g:message code="New Project" args="[entityName]" /></g:link></li>

				<g:if  test="${session.user == null}">
				
				<li><g:link class="login" controller= "user" action="login"><g:message code="Login" args="[entityName]" /></g:link></li>
				</g:if> 
				
				<g:else>	
				<li><g:link class="login" controller= "user" action="logout"><g:message code="Logout" args="[entityName]" /></g:link></li>				</g:else>
			</ul>
			</ul>
		</div>
		<div id="show-project" class="content scaffold-show" role="main">
			<h1><g:message code="default.show.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<ol class="property-list project">
			
				<g:if test="${projectInstance?.name}">
				<li class="fieldcontain">
					<span id="name-label" class="property-label"><g:message code="project.name.label" default="Name" /></span>
					
						<span class="property-value" aria-labelledby="name-label"><g:fieldValue bean="${projectInstance}" field="name"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${projectInstance?.description}">
				<li class="fieldcontain">
					<span id="description-label" class="property-label"><g:message code="project.description.label" default="Description" /></span>
					
						<span class="property-value" aria-labelledby="description-label"><g:fieldValue bean="${projectInstance}" field="description"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${projectInstance?.projectManager}">
				<li class="fieldcontain">
					<span id="projectManager-label" class="property-label"><g:message code="project.projectManager.label" default="Project Manager" /></span>
					
						<span class="property-value" aria-labelledby="projectManager-label"><g:link controller="user" action="show" id="${projectInstance?.projectManager?.id}">${projectInstance?.projectManager?.encodeAsHTML()}</g:link></span>
					
				</li>
				</g:if>
			
				<g:if test="${projectInstance?.status}">
				<li class="fieldcontain">
					<span id="status-label" class="property-label"><g:message code="project.status.label" default="Status" /></span>
					
						<span class="property-value" aria-labelledby="status-label"><g:fieldValue bean="${projectInstance}" field="status"/></span>
					
				</li>
				</g:if>
			
				<g:if test="${projectInstance?.dueDate}">
				<li class="fieldcontain">
					<span id="dueDate-label" class="property-label"><g:message code="project.dueDate.label" default="Due Date" /></span>
					
						<span class="property-value" aria-labelledby="dueDate-label"><g:formatDate date="${projectInstance?.dueDate}" /></span>
					
				</li>
				</g:if>
			
				
				
				<li class="fieldcontain">
					<span id="teamMembers-label" class="property-label"><g:message code="project.teamMembers.label" default="Team Members" /></span>
					<g:if test="${projectInstance?.teamMembers}">
						<g:each in="${projectInstance.teamMembers}" var="t">
						<span class="property-value" aria-labelledby="teamMembers-label"><g:link controller="membership" action="show" id="${t.id}">${t?.encodeAsHTML()}</g:link></span>
						</g:each>
					</g:if>
					<span class= "property-value" ><g:link controller="membership" action="create" params="['project.id': projectInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'membership.label', default: 'Team Member')])}</g:link>
					</span>
				</li>
				
				
				
				
				
				<li class="fieldcontain">
					<span id="risks-label" class="property-label"><g:message code="project.risks.label" default="Risks" /></span>
					<g:if test="${projectInstance?.risks}">
						<g:each in="${projectInstance.risks}" var="r">
						<span class="property-value" aria-labelledby="risks-label"><g:link controller="risk" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></span>
						</g:each>
					</g:if>
					<span class= "property-value" ><g:link controller="risk" action="create" params="['project.id': projectInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'risk.label', default: 'Risk')])}</g:link>
					
				</li>
				
			
			
			</ol>
			<g:form>
				<fieldset class="buttons">
					<g:hiddenField name="id" value="${projectInstance?.id}" />
					<g:link class="edit" action="edit" id="${projectInstance?.id}"><g:message code="default.button.edit.label" default="Edit" /></g:link>
					<g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
				</fieldset>
			</g:form>
		</div>
	</body>
</html>
